package edu.sctu.practice.class02.yangshengyu.two10;

import java.util.Scanner;

/**
 * Created by Cullen on 2015/8/11.
 */
public class N21 {
    public static void main(String[] args) {
        System.out.println("请输入含大小写字母的字符串：");
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int DX = 0;
        int XX = 0;
        for (int i = 0; i < str.length(); ++i) {
            char ch = str.charAt(i);
            if (ch >= 'a' && ch <= 'z') {
                XX++;
            } else if (ch >= 'A' && ch <= 'Z') {
                DX++;
            }
        }

        System.out.println("大写字符有"+DX+"个！");
        System.out.println("小写字符有"+XX+"个！");
        if (XX>DX){
            System.out.println("最大值是："+XX);
        }else{
            System.out.println("最大值是："+DX);
        }
        }
}



